(function () {
    // public    静态类 (默认)
    // private   私有类
    // protected 包含类
    class MyInfo {
        private name: string
        private age: number
        constructor(name: string, age: number) {
            this.name = name
            this.age = age
        }
        get myName() {
            return this.name
        }
        set myName(value: string) {
            this.name = value
        }
        get codeAge() {
            return this.age
        }
        set codeAge(value: number) {
            if (value >= 0) {
                this.age = value
            }
        }
        public add(): void {}
    }

    const gao = new MyInfo('gao', 18)
    gao.myName = 'xiang'
    gao.codeAge = 33
    console.log(gao)
})()